﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RssGroupList.ascx.cs" Inherits="admin_webparts_Plug_ins_RssNews_RssGroupList" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<%@ Import Namespace="NTTHAO.Web.BL.Rss" %>

<%
    string bUrl = "?type=" + Request.QueryString["type"] + "&name=" + Request.QueryString["name"] + "&item=" + Request.QueryString["item"];
    bool isAdmin = Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase);
    int langID = LanguageUtility.GetLanguageID();
    int siteID = WebGlobal.GetSite().ID;
%>
<div class="tip" style="position: relative;">
	<h1 style="left: 0px; position: relative;">Nhóm tin tức RSS</h1>
	<div style="display: block; width: 32px; height: 32px; float: right; position: absolute; top: 5px; right: 5px;"><a title="Click vào đây để quay lại." href="?type=page&name=<%=Request.QueryString["name"] %>"><img alt="Back" src="resources/images/Back.png" /></a></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
    <tr>
        <th width="42px">#</th>
        <th>Tên</th>
        <th>Kích hoạt</th>
    </tr>
<%
if (RssPageGroup.RssPageGroups != null)
{
    int count = 0;
    for (int i = 0; i < RssPageGroup.RssPageGroups.Count; i++)
    {
        RssPageGroup g = RssPageGroup.RssPageGroups[i];
        if (g.LangID == langID && g.SiteID == siteID && (g.Activated || isAdmin))
        {
            count++;
%>
    <tr class="<%=(count%2==0?"even":"odd") %>">
        <td align="center"><%=count %></td>
        <td align="left"><a href="<%=bUrl+"&g="+g.ID.ToString()%>"><b><%=g.Name %></b></a></td>
        <td align="center"><%=(g.Activated ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
    </tr>
<%
        }
    }
} 
%>

</table>